using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Samples.SqlServer.SSIS.EventLogSource;
using System.IO;

namespace TestEventLogSource
{
    class Program
    {
        static void Main(string[] args)
        {
            string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"Visual Studio 2005\Projects\EventLogDataSource\logs\");
            using (EventFile eventFile = new EventFile(Path.Combine(path, "Application.evt"), "Application"))
            using (StreamWriter sw = File.CreateText(Path.Combine(path, "testOutput.txt")))
            {
                foreach (EventRecord record in eventFile)
                {
                    //Console.WriteLine(record.ToString());
                    sw.WriteLine(record.ToString());
                }
            }
        }
    }
}
